AREngineFrameSource Class

Description

A custom frame source which connects AREngine camera device output to EasyAR input in the scene, providing AR Engine support using custom camera feature of EasyAR Sense.

This frame source is one type of motion tracking device, and will output motion data in a ARSession .

Huawei AR Engine Unity SDK is NOT required to use this frame source.

To choose frame source in runtime, you can deactive Camera GameObject and set all required values of all frame sources for availability check, and active Camera GameObject when this frame source is chosen.


MonoBehaviour Messages

protected virtual void Awake()

protected virtual void OnEnable()

protected virtual void OnDisable()


Fields

AutoFocus

C#

public bool AutoFocus

Set focus mode when device is opening. Note: auto focus switch may not work on some devices due to hardware or system limitation.

DeviceListDownloaderTimeout

C#

public float DeviceListDownloaderTimeout

Timeout in seconds to update device list from server when checking availability using AREngineFrameSource.CheckAvailability . Set value less than 0 to skip update from server.

AlwaysWaitDeviceListUpdate

C#

public bool AlwaysWaitDeviceListUpdate

By default, AREngineFrameSource.CheckAvailability will return immediately if device is supported with current device list data, and the updated list will be used in the next run. Turn on this option If you want to ensure list update in each run.


Properties

IsAvailable

C#

public override Optional<bool> IsAvailable { get; }

If the frame source is available.

If the value equals null, FrameSource.CheckAvailability must be called and the value can be accessed after Coroutine finish. This property is used by ARComponentPicker when picking frame source.

WorldRoot

C#

public WorldRootController WorldRoot { get; set; }

The object Camera move against, will be automatically get from the scene or generate if not set.

Origin

C#

public override GameObject Origin { get; }

Origin of ARSession if the frame source can output motion tracking data.

Each type of motion tracking frame source has its own method to set the origin object containing some specific component. Some frame source will automatic pick a usable object from active objects in the scene or generate an object if the value is not set.

AvailableCenterMode

C#

public virtual IReadOnlyList< ARSession.ARCenterMode > AvailableCenterMode { get; }

Available center mode of the frame source.

Camera

C#

public virtual Camera Camera { get; set; }

Camera used by the frame source in an ARSession .

Each type of frame source has its own method to check if the camera is usable, and will reject value set if the camera is not usable by the frame source. This property is used by ARComponentPicker when picking frame source to determine if the frame source is available, and some frame source will automatic pick a usable Camera from active objects in the scene in the process if the value is not set. You can set this value to a usable Camera before session start. The value cannot be changed after ARSession is ready if the frame source is selected in the session.


Methods

CheckAvailability

C#

public override System.Collections.IEnumerator CheckAvailability()

Coroutine to check frame source availability when FrameSource.IsAvailable equals null.

Open

C#

public void Open()

Open device.

Close

C#

public void Close()

Close device.